
export class SessionStorage {

    private static SessionStorage: SessionStorage;

    public static getInstance(): SessionStorage {
        if (!SessionStorage.SessionStorage) {
            SessionStorage.SessionStorage = new SessionStorage();
        }
        return this.SessionStorage;
    }
   public get (key:any) {
        let v = sessionStorage.getItem(key);
        if (v && typeof(v) !== "undefined" && v !== "undefined") {
            return JSON.parse(v);
        }
    }
   public set (key:any, data:any) {
        sessionStorage.setItem(key, JSON.stringify(data));
    }
    public remove(key:any) {
        sessionStorage.removeItem(key);
    }
    public clearAll () {
        sessionStorage.clear();
    }
};
declare module "vue/types/vue" {
    interface Vue {
        /**
         * Http net 对象
         *
         * @type {Http}
         * @memberof Vue
         */
        $SessionStorage: SessionStorage;
    }
}
